package com.game.chinesechess.util;

import com.google.gson.Gson;

public class information {
    public Point begin,end;
    public information(int x1,int y1,int x2,int y2){
        begin=new Point(x1,y1);
        end=new Point(x2,y2);
    }

    public String toJson(){
        return new Gson().toJson(this);
    }

    public static Point getStartPoint(String json){
        return  new Gson().fromJson(json, information.class).begin;
    }

    public static Point getEndPoint(String json){
        return  new Gson().fromJson(json, information.class).end;
    }
}
